package com.ruoyi.law.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.law.mapper.ContentCaseFlowMapper;
import com.ruoyi.law.domain.ContentCaseFlow;
import com.ruoyi.law.service.IContentCaseFlowService;

/**
 * 流程主体Service业务层处理
 * 
 * @author gyl
 * @date 2025-02-27
 */
@Service
public class ContentCaseFlowServiceImpl implements IContentCaseFlowService 
{
    @Autowired
    private ContentCaseFlowMapper contentCaseFlowMapper;

    /**
     * 查询流程主体
     * 
     * @param flowId 流程主体主键
     * @return 流程主体
     */
    @Override
    public ContentCaseFlow selectContentCaseFlowByFlowId(Long flowId)
    {
        return contentCaseFlowMapper.selectContentCaseFlowByFlowId(flowId);
    }

    /**
     * 查询流程主体列表
     * 
     * @param contentCaseFlow 流程主体
     * @return 流程主体
     */
    @Override
    public List<ContentCaseFlow> selectContentCaseFlowList(ContentCaseFlow contentCaseFlow)
    {
        return contentCaseFlowMapper.selectContentCaseFlowList(contentCaseFlow);
    }

    /**
     * 新增流程主体
     * 
     * @param contentCaseFlow 流程主体
     * @return 结果
     */
    @Override
    public int insertContentCaseFlow(ContentCaseFlow contentCaseFlow)
    {
        contentCaseFlow.setCreateTime(DateUtils.getNowDate());
        return contentCaseFlowMapper.insertContentCaseFlow(contentCaseFlow);
    }

    /**
     * 修改流程主体
     * 
     * @param contentCaseFlow 流程主体
     * @return 结果
     */
    @Override
    public int updateContentCaseFlow(ContentCaseFlow contentCaseFlow)
    {
        contentCaseFlow.setUpdateTime(DateUtils.getNowDate());
        return contentCaseFlowMapper.updateContentCaseFlow(contentCaseFlow);
    }

    /**
     * 批量删除流程主体
     * 
     * @param flowIds 需要删除的流程主体主键
     * @return 结果
     */
    @Override
    public int deleteContentCaseFlowByFlowIds(Long[] flowIds)
    {
        return contentCaseFlowMapper.deleteContentCaseFlowByFlowIds(flowIds);
    }

    /**
     * 删除流程主体信息
     * 
     * @param flowId 流程主体主键
     * @return 结果
     */
    @Override
    public int deleteContentCaseFlowByFlowId(Long flowId)
    {
        return contentCaseFlowMapper.deleteContentCaseFlowByFlowId(flowId);
    }
}
